package com.example.rmiclientdemo.controller;

import com.example.rmiclientdemo.client.RmiClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangyan01
 */

@Slf4j
@RestController
@RequestMapping("rmi")
public class RmiController {


    @Autowired
    private RmiClient rmiClient;

    @GetMapping(value = "/hello")
    public String hello() throws Exception {
        return rmiClient.run();
    }

    @GetMapping(value = "/hello1")
    public void hello1() throws Exception {
        rmiClient.run1();
    }


    @GetMapping(value = "/hello2")
    public void hello2() throws Exception {
        rmiClient.run2();
    }


}
